#include "StdAfx.h"
#include "ButtonWin32.h"

ButtonWin32::ButtonWin32() {
}

ButtonWin32::~ButtonWin32(void) {
}


void ButtonWin32::AddOnActionCallback(Notify::NotifyCallback onButtonAction) {
	Notify::Add(this, GuiObject::ON_CLICK, onButtonAction);
}

void ButtonWin32::Create(UIHAND parent) {
	CreateWindowEx(0, L"button", text.c_str(), WS_CHILD|WS_VISIBLE, 100, 100, 50, 50, parent, 0, GetModuleHandle(0), BASE_THIS);
}
void ButtonWin32::Destroy() {

}
void ButtonWin32::SetText(String text) {
	this->text = text;
}
UIHAND ButtonWin32::GetUIHand() {
	return GetWnd();
}
void ButtonWin32::SetUIHand(UIHAND uiHand) {
	SetWnd(uiHand);
}
void ButtonWin32::SetParent(UIHAND parent) {
	::SetParent(GetUIHand(), parent);
}
void ButtonWin32::AddChild(GuiObject& child) {
	child.SetParent(GetUIHand());
}